/**
 * 深度只读工具
 */
type DeepReadonly<T extends Record<string | symbol, any>> = {
  readonly [P in keyof T]: DeepReadonly<T[P]>;
};

interface Obj1 {
  a: symbol;
  b: string;
  c: {
    d: boolean;
  };
}

const obj1: DeepReadonly<Obj1> = {
  a: Symbol.for("1"),
  b: "2",
  c: {
    d: true
  }
};

// const obj2: DeepReadonly<string> = "11222";

// obj1.a = 2;
// obj1.c.d = false;
